/**
 * Created by jackie on 2018/1/1.
 */

function lk(myname,type1,type2){
    $(document).scroll(function(){
        if(($("."+myname).offset().top - $(window).scrollTop()) < $(window).height()){
            $("."+myname).find(".title").addClass(type1).css("opacity","1");
            $("."+myname).find("li").addClass(type1).css("opacity","1");
            $("."+myname).find("h3").addClass(type1).css("opacity","1");
            $("."+myname).find("h4").addClass(type1).css("opacity","1");

            $("."+myname).find(".list03_left").addClass(type1).css("opacity","1");
            $("."+myname).find(".list03_right_con").addClass(type2).css("opacity","1");
            $("."+myname).find(".list03_right_conn").addClass(type2).css("opacity","1");

            $("."+myname).find(".li").addClass(type1).css("opacity","1");


        }else{
            $("."+myname).find(".title").removeClass(type1).css("opacity","0");
            $("."+myname).find("li").removeClass(type1).css("opacity","0");
            $("."+myname).find("h3").removeClass(type1).css("opacity","0");
            $("."+myname).find("h4").removeClass(type1).css("opacity","0");

            $("."+myname).find(".list03_left").removeClass(type1).css("opacity","0");
            $("."+myname).find(".list03_right_con").removeClass(type2).css("opacity","0");
            $("."+myname).find(".list03_right_conn").removeClass(type2).css("opacity","0");

            $("."+myname).find(".li").removeClass(type1).css("opacity","0");


        }
    })
}

lk("ani","fadeInUp");
lk("ani1","fadeInUp");
lk("ani2","fadeInLeft", "fadeInRight");
lk("ani3","fadeInUp");
